function newChildren = cross( crossType, individual1, individual2 )
    global weightsSize patterns solutions anularLength probUniformCross;
    
    
    switch crossType 
        case 1 %CLASSIC
            crossPoint = randi(weightsSize-1,1,1)+1;
            
            newValue1 = [ individual1(1:crossPoint-1), individual2(crossPoint:end)];
            newValue2 = [ individual2(1:crossPoint-1), individual1(crossPoint:end)];

        case 2 %MULTIPLE
            crossPoints = randi(weightsSize-1,1,2)+1;
            fstCross = min(crossPoints);
            sndCross = max(crossPoints);
            
            newValue1 = [ individual1(1:fstCross-1), individual2(fstCross:sndCross-1), individual1(sndCross:end)];
            newValue2 = [ individual2(1:fstCross-1), individual1(fstCross:sndCross-1), individual2(sndCross:end)];
            
        case 3 %UNIFORM
            newValue1 = individual1;
            newValue2 = individual2;
        
            for i=1:weightsSize
                if rand() < probUniformCross
                    newValue1(i) = individual2(i);
                    newValue2(i) = individual1(i);
                end
            end
        
        case 4 %ANULAR
            crossPoint = randi(weightsSize-1,1,1)+1;
            anularPoint = mod(crossPoint+ceil(anularLength), weightsSize)+1;
            
            if crossPoint < anularPoint
                newValue1 = [ individual1(1:crossPoint-1), individual2(crossPoint:anularPoint-1), individual1(anularPoint:end)];
                newValue2 = [ individual2(1:crossPoint-1), individual1(crossPoint:anularPoint-1), individual2(anularPoint:end)];
            else
                newValue1 = [ individual2(1:anularPoint-1), individual1(anularPoint:crossPoint-1), individual2(crossPoint:end)];
                newValue2 = [ individual1(1:anularPoint-1), individual1(anularPoint:crossPoint-1), individual2(crossPoint:end)];                
            end
            
        otherwise 
            disp('error in cross type');
    end

    newChildren.individuals{1} = newValue1;
    newChildren.fitness(1) = main(newValue1);
    newChildren.individuals{2} = newValue2;
    newChildren.fitness(2) = main(newValue2);

end

